package com.ycfmedical.bed.ui.fragment;

import android.os.Bundle;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bilibili.magicasakura.widgets.TintImageView;
import com.ycfmedical.bed.R;
import com.ycfmedical.bed.bean.ImUser;
import com.ycfmedical.bed.ui.ImActivity;

import butterknife.BindView;
import butterknife.OnClick;
import butterknife.Unbinder;
import cn.droidlover.xdroidmvp.kit.Kits;
import cn.droidlover.xdroidmvp.mvp.XFragment;

/**
 * Created by Administrator on 2017-04-14.
 */
public class ChatFragment extends XFragment {


    @BindView(R.id.toChatActivityBtn)
    ImageView toChatActivityBtn;
    Unbinder unbinder;
    Unbinder unbinder1;

    @Override
    public void initData(Bundle savedInstanceState) {

    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_usercenter_chat;
    }

    @Override
    public Object newP() {
        return null;
    }

    @OnClick(R.id.toChatActivityBtn)
    public void onViewClicked() {


        if (isImCanUse()) {
            ImActivity.launch(getActivity());
        }else {
            getvDelegate().toastShort("IM账号登录异常，暂时无法使用聊天功能呀~");
        }
    }

    private boolean isImCanUse() {
        boolean isImCanuse;
        if (!Kits.Empty.check(ImUser.getInstance().getImAccount())) {
            isImCanuse = true;
        } else {


            isImCanuse = false;
        }
        return isImCanuse;
    }

}
